#include "UserMotor.h"
#include "ZY_FOC.h"
int m_sp=0;
/********************
 * 设置电机运行速度，单位rad
********************/
void SetMotorSpeed(float speed)
{
    m_sp=speed;
	ZY_SetMotorSpeed(m_sp);
}
void SetMotorRun(uint8_t model,int32_t value)
{
	if(model==MotorControl_Model_velocity)
	{
		SetMotorSpeed((float)value/100.0);
	}
}
float GetMotorSpeed(void)
{
	return ZY_GetMotorSpeed();
}
float GetMotorAngle(void)
{
	return ZY_GetMotorAngle();
}
/************************
 *获取PID 速度环
************************/
PID_t GetPID_Velocity()
{
	return ZY_GetPID_Velocity();
}
/**********************
***********************/
PID_t GetPID_Angle()
{
	return ZY_GetPID_Angle();
}
PID_t GetPID_Current()
{
	return ZY_GetPID_Current();
}
void SetPID_Velocity(PID_t pid)
{
	ZY_SetPID_Velocity(pid);
}